<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      // class 类
      // Perosn 函数
      class Perosn {
        constructor() {
          // this = {}
          // this.__proto__ = Person.prototype;
          this.name = "jack";
          this.age = 20;
          // return this;
        }
        say() {
          console.log("hello");
        }
        add(x, y) {
          return x + y;
        }
      }
      const p1 = new Perosn();
      p1.say(); //hello
      console.log(p1.add(1, 2)); //3
    </script>
  </body>
</html>
